package fzdy.controller;

import com.mashape.unirest.request.HttpRequest;
import lombok.Cleanup;
import org.apache.http.HttpResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;

@Controller
@RequestMapping("/sysmanage")
public class VedioController {

    @RequestMapping(value = "/vedio",method = RequestMethod.GET)
    public void playVedio(HttpServletRequest request, HttpServletResponse response) throws IOException{
        File file = new File("");
        InputStream in = null;
        ServletOutputStream out = null;
        in = new FileInputStream(file);
        out = response.getOutputStream();
        byte[] buffer = new byte[4 * 1024];
        int length;
        while ((length = in.read(buffer)) > 0) {
            out.write(buffer, 0, length);
        }

    }
}
